/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.dao.estagio;

import ejb.dao.AbstractFacade;
import java.util.HashMap;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Gomes
 */
@Stateless(mappedName = "AlertaFacadeEJB")
public class AlertaFacade extends AbstractFacade<Alerta> implements AlertaFacadeLocal {

    @PersistenceContext(unitName = "Sigef-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public AlertaFacade() {
        super(Alerta.class);
    }
  

    @Override
    public List<Alerta> listAlertas() {
     List<Alerta> alertas = null;        
        alertas = executeQuery("FROM Alerta ORDER BY dataAlerta",0,null);
        return alertas;
    }
}
